package com.aring.deals.admin.actions;

import org.apache.struts2.ServletActionContext;

import com.aring.constant.ResultCode;
import com.aring.deals.tool.CheckAdmin;
import com.aring.deals.tool.LogTool;

@SuppressWarnings("serial")
public class ReadLog extends BasicAction {

	/**
	 * @param args
	 */
	@Override
	public String execute() throws Exception {
		if(CheckAdmin.checkAdmin()!=ResultCode.SUCCESS_CODE){
			CheckAdmin.checkAdminError();
			return null;
		}
		setOut(ServletActionContext.getResponse().getWriter());
		getOut().write(LogTool.getLogs());
		getOut().flush();
		getOut().close();
		return null;
	}

}
